<template name="SettingCompanyModal">
  <div class="modal fade modal-rounded">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-label="Close">&times;</button>
          <h4 class="modal-title">{{_ 'settings_company'}}</h4>
        </div>
        <div class="modal-body">
          <dl>
            <dt>{{_ "setup_company_name"}}</dt>
            <dd>
              {{#with instance}}
                {{company}}
                <a href="#" id="btn-modify-company">{{_ "app_action_edit"}}</a>
              {{/with}}
            </dd>
          </dl>
          <dl>
            <dt>{{_ "setup_domain"}}</dt>
            <dd>
              {{#with instance}}
                {{domain}}
                <a href="#" id="btn-modify-domain">{{_ "app_action_edit"}}</a>
              {{/with}}
            </dd>
          </dl>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">{{_ "app_action_close"}}</button>
        </div>
      </div>
    </div>
  </div>
</template>

<template name="SettingEmailModal">
  <div class="modal fade modal-rounded">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-label="Close">&times;</button>
          <h4 class="modal-title">{{_ 'settings_email'}}</h4>
        </div>
        <div class="modal-body">
          <dl>
            <dt>{{_ "settings_email_send"}}</dt>
            <dd>
              {{#with instance.modules.email}}
                Mailgun: {{mailgun.key}}
                <a href="#" id="btn-modify-key">{{_ "app_action_edit"}}</a>
                {{#if mailgun.key_valid}}
                  <span class="pull-right"><i class="fa fa-check text-green"></i></span>
                {{else}}
                  <span class="pull-right"><i class="fa fa-close text-red"></i></span>
                {{/if}}
              {{else}}
                {{_ "setup_email_disabled"}}
                <a href="#" id="btn-modify-key">{{_ "settings_email_set_mailgun"}}</a>
              {{/with}}
            </dd>
          </dl>
          <dl>
            <dt>{{_ "settings_email_receive"}}</dt>
            <dd>
              {{mailgun_api_url}}
              {{#if instance.modules.email.mailgun.domain_valid}}
                <span class="pull-right"><i class="fa fa-check text-green"></i></span>
              {{else}}
                <span class="pull-right"><i class="fa fa-close text-red"></i></span>
              {{/if}}
            </dd>
          </dl>
        </div>
        <div class="modal-footer">
          <!-- {{#with instance.modules.email}}
            {{#unless compare mailgun.key_valid '&&' mailgun.domain_valid}}
              <button type="button" class="btn btn-success pull-left" id="btn-validate">{{_ "Validate"}}</button>
            {{/unless}}
          {{/with}} -->
          <button type="button" class="btn btn-default" data-dismiss="modal">{{_ "app_action_close"}}</button>
        </div>
      </div>
    </div>
  </div>
</template>

<template name="SettingStorageModal">
  <div class="modal fade modal-rounded">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-label="Close">&times;</button>
          <h4 class="modal-title">{{_ 'settings_storage'}}</h4>
        </div>
        <div class="modal-body">
          {{#with instance.modules.storage.s3}}
            <dl>
              <dt>{{_ "setup_storage_info"}}</dt>
              <dd>Amazon S3</dd>
            </dl>
            <dl>
              <dt>Key</dt>
              <dd>{{key}}</dd>
            </dl>
            <dl>
              <dt>Secret</dt>
              <dd>{{secret}}</dd>
            </dl>
            <dl>
              <dt>Bucket</dt>
              <dd>{{bucket}}</dd>
            </dl>
            <dl>
              <dt>Region</dt>
              <dd>{{region}}</dd>
            </dl>
          {{else}}
          <dl>
            <dt>{{_ "setup_storage_info"}}</dt>
            <dd>
              {{_ "setup_storage_local"}}
              <span class="pull-right"><i class="fa fa-check text-green"></i></span>
            </dd>
          </dl>
          {{/with}}
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">{{_ "app_action_close"}}</button>
        </div>
      </div>
    </div>
  </div>
</template>
